<template>
	<div class="error">
		<div class="error-container">
			<div class="iconfont icon-error"></div>
			<router-link to="/" class="error-message">页面找不到了~ 点击返回首页！</router-link>
			<div class="error-message">{{time}}秒后自动返回首页</div>
		</div>
	</div>
</template>

<script>
	export default {
		name: "error",
		data() {
			return {
				time: 5
			}
		},
		methods: {
			overTime() {
				this.time--;
				if (!this.time) {
					this.$router.push('/');
				}
			}
		},
		mounted() {
			setInterval(() => {
				this.overTime();
			}, 1000)
		}
	}
</script>
